package com.redsoil.house.ui.news.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.redsoil.house.R;
import com.redsoil.house.base.BaseViewHolderTSK;
import com.redsoil.house.model.bean.NewsVO;
import com.redsoil.house.model.bean.TestVO;
import com.redsoil.house.model.http.api.ApiConstants;
import com.redsoil.house.widget.glide.GlideRoundTransform;

import java.util.List;

/**
 * Created by weidingqiang on 2018/12/20.
 */

public class NewsAdapter extends BaseQuickAdapter<NewsVO.DataListBean,BaseViewHolderTSK> {

    public NewsAdapter(int layoutResId, List<NewsVO.DataListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolderTSK helper, NewsVO.DataListBean item) {

        helper.setText(R.id.news_title_tv,item.getTitle());

        helper.setText(R.id.news_contain_tv,item.getSummary());

        Glide.with(mContext)
                .load(ApiConstants.STATIC_FILE+item.getCoverPic())
                .centerCrop()
                .into((ImageView)helper.getView(R.id.news_img));
    }
}
